$(document).ready(function(){
	// 设置主页校色
	var userRole,userObject,menuList = [];
	userObject = JSON.parse(localStorage.getItem("currentUser"));
	if(userObject.role == 1) {
		userRole = '系统管理员';
		menuList = [1,2,3,4]
	} else if (userObject.role == 2) {
		userRole = '库管理员';
		menuList = [1,4]
	} else if (userObject.role == 3) {
		userRole = '带电班成员';
		menuList = [1,4]
	}
	$(".logoRight .role").text(userRole);
	//各角色尅看到的选项卡
	menuList.forEach(function(obj){	
		if (obj!=null && obj != '') {
			$("."+obj).removeClass("hide");
		}
	})
	//面包屑breadcrumb
	$(".nav li").click(function(){
		$(".breadcrumb .active").text($(this).attr("data-text"));
		$("#home_iframe").attr("src",$(this).attr("datalink"));
		$(this).addClass("activeBG").siblings("li").removeClass("activeBG");
	})
	//点击退出按钮
	$(".logoRight .exit").click(function(){
		localStorage.clear("currentUser");
		window.location.href = "login/html/login.html";
	})
	
})